1. Field of the Invention
The present invention relates to a digital camera provided with a gradation correction function, and a gradation correction method and a program used therefor.
2. Description of the Related Art
Conventionally, a digital camera includes a built-in flash unit to compensate insufficiency of light for photographing. However, because the reach of the flash is limited, sufficient amount of light may not be obtained when photographing an object which is far away from the camera or photographing wide range. The downsizing of digital cameras in recent years leads to the downsizing of flash units, and the amount of light becomes smaller. Moreover, the downsizing of digital cameras causes the downsizing of cell-size of an imaging sensor, and photographic sensitivity decreases. Therefore, the amount of light is insufficient in spite of using a flash, and expected brightness cannot be obtained in many cases. In order to solve the problem, there is a method to control the exposure at the time of photographing in Jpn. Pat. Appln. KOKAI Publication No. 07-274062. According to the technique described in the above reference, for example, exposure is controlled by controlling an aperture and a shutter in such a way that an object with the highest luminance becomes the brightest within a dynamic range of about 70% through 100% of the image sensor, that is, within a range in which saturation is not caused, regardless of the luminance distribution and the position in an image. Thus, an appropriate exposure for a bright object and also for a dark object may be obtained without any correction.
However, because the above-described method merely adjusts the exposure to be high within a range in which the gradation of an area corresponding to a bright object can be maintained, the result of photographing is not always preferable. In this method, an aperture and a shutter are controlled only for adjustment of brightness before photographing. Accordingly, the brightness may not be appropriately corrected for an image including an object which does not receive enough light when photographing. For example, when an image has a short-distance area (main object) which is irradiated enough with a flash, and a long-distance area (background) which light of a flash does not reach, such as when photographing a night scene, the portion of the object which is at a short distance is bright enough by the flash, but the portion of the object which is at a long distance is left dark because the flash does not reach the portion. Therefore, there is a problem that a gradation of the dark long-distance area is extremely poor, although a gradation of the bright short-distance area can be maintained.